package repository

import (
	"github.com/lab-online/internal/course/entity"
	"github.com/lab-online/internal/course/infra/model"
)

func (r *Repository) DeleteCourse(courseEntity entity.CourseEntity) error {
	query := model.NewCourse(model.WithCourseID(courseEntity.GetID()))
	err := r.db.Delete(query).Error
	return errorHandler(err)
}

func (r *Repository) DeleteExperiment(experimentEntity entity.ExperimentEntity) error {
	query := model.NewExperiment(model.WithExperimentID(experimentEntity.GetID()))
	err := r.db.Delete(query).Error
	return errorHandler(err)
}
